package com.tianpengtech.front.web.job;

import com.tianpengtech.common.model.task.Task;
import com.tianpengtech.common.model.user.Session;
import com.tianpengtech.front.web.login.LoginService;
import com.tianpengtech.front.web.task.TaskService;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;

import java.util.List;

/**
 * Created by Administrator on 2017/6/21 0021.
 */
public class SessionJob implements Job {

    private static LoginService loginService = new LoginService();
    @Override
    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        List<Session> sessions = loginService.findEndTimeSession();
        for (Session s: sessions) {
            s.delete();
        }
    }
}
